]> dgit.raspbian.org Git - ostree.git/commitdiff
tests/xtask: Fix cargo fmt formatting
authorXiaofeng Wang <henrywangxf@me.com>
Tue, 31 Mar 2026 04:06:55 +0000 (12:06 +0800)
committerXiaofeng Wang <henrywangxf@me.com>
Tue, 31 Mar 2026 04:06:55 +0000 (12:06 +0800)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
tests/xtask/src/tmt.rs

index 460cc5e1d8a272ec3d1e0de2d028ecbe64a1d443..54fc9eeea221ff13e20b15e4602afb204cfb027b 100644 (file)
@@ -1,8 +1,8 @@
 use std::io::Write;
 
-use anyhow::{Context, Result, bail};
+use anyhow::{bail, Context, Result};
 use clap::Parser;
-use xshell::{Shell, cmd};
+use xshell::{cmd, Shell};
 
 /// Maximum time to wait for SSH to become available (in seconds).
 const SSH_TIMEOUT_SECS: u64 = 300;
@@ -75,11 +75,7 @@ pub(crate) fn run_tmt(sh: &Shell, args: RunTmtArgs) -> Result<()> {
         eprintln!("All {} test plan(s) passed", plans.len());
         Ok(())
     } else {
-        eprintln!(
-            "{} of {} plan(s) failed:",
-            failures.len(),
-            plans.len()
-        );
+        eprintln!("{} of {} plan(s) failed:", failures.len(), plans.len());
         for (plan, err) in &failures {
             eprintln!("  {plan}: {err}");
         }
@@ -119,13 +115,7 @@ fn discover_plans(sh: &Shell, filters: &[String]) -> Result<Vec<String>> {
 }
 
 /// Run a single TMT plan in a dedicated bcvk VM.
-fn run_plan(
-    sh: &Shell,
-    args: &RunTmtArgs,
-    image: &str,
-    plan: &str,
-    vm_name: &str,
-) -> Result<()> {
+fn run_plan(sh: &Shell, args: &RunTmtArgs, image: &str, plan: &str, vm_name: &str) -> Result<()> {
     // Launch the VM
     cmd!(sh, "bcvk libvirt run --name {vm_name} --detach {image}")
         .run()
@@ -184,9 +174,7 @@ fn wait_for_ssh(sh: &Shell, vm_name: &str) -> Result<()> {
         std::thread::sleep(std::time::Duration::from_secs(SSH_POLL_INTERVAL_SECS));
     }
 
-    bail!(
-        "Timeout waiting for SSH on {vm_name} after {SSH_TIMEOUT_SECS}s"
-    );
+    bail!("Timeout waiting for SSH on {vm_name} after {SSH_TIMEOUT_SECS}s");
 }
 
 /// Clean up a bcvk VM, ignoring errors.